namespace Backoffice.Application.Common;

public class ApiResult
{
    public int Code { get; set; }
    public string Msg { get; set; } = null!;
    public object? Data { get; set; }

    public static ApiResult Success(object? data = null, string msg = "操作成功")
    {
        return new ApiResult
        {
            Code = 10000,
            Msg = msg,
            Data = data
        };
    }
    public static ApiResult Fail(string msg = "操作失败", int code = 10001, object? data = null)
    {
        return new ApiResult
        {
            Code = code,
            Msg = msg,
            Data = data
        };
    }


}

